package com.ittest.mapper.store;

import com.ittest.domain.store.Traveller;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface TravellerMapper {
 //根据订单id查询旅游者信息

    @Select("SELECT * FROM  " +
            "traveller  " +
            "WHERE id  " +
            "IN ( " +
            "SELECT  " +
            "travellerId " +
            "FROM  " +
            "order_traveller " +
            "WHERE " +
            "orderId = #{id})")
    @Results({
            @Result(id = true,column = "id",property = "id"),
            @Result(column = "NAME",property = "name"),
            @Result(column = "sex",property = "sex"),
            @Result(column = "phoneNum",property = "phoneNum"),
            @Result(column = "credentialsType",property = "credentialsType"),
            @Result(column = "credentialsNum",property = "credentialsNum"),
            @Result(column = "travellerType",property = "travellerType"),
    })
    List<Traveller> findByOrderId(String id);
}
